﻿@inherits Isha.Web.Mvc.IshaViewPage
@{
    string PartName = IshaModel.ContentItem.Type.Name.ToString();
}
@if (IshaContext.Current.ListContents.Count() > 0)
{
    <table summary="Content listing" id="listing-table" class="listing">
        <thead>
            <tr>
                <th id="foldercontents-order-column" class="nosort column">
                </th>
                <th id="foldercontents-title-column" class="nosort column">
                    &nbsp;Title&nbsp;
                </th>
                <th id="foldercontents-size-column" class="nosort column">
                    &nbsp;Size&nbsp;
                </th>
                <th id="foldercontents-modified-column" class="nosort column">
                    &nbsp;Modified&nbsp;
                </th>
                <th id="foldercontents-status-column" class="nosort column">
                    &nbsp;State&nbsp;
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in IshaContext.Current.ListContents)
            {
                <tr id="folder-contents-item-front-page" class="draggable odd">
                    <td class="draggable draggingHook" style="cursor: ns-resize;">
                        ⣿
                    </td>
                    <td>
                        <a class=" state-published contenttype-document" href="./@(item.Link + (item.ContentItems.Count > 0 ? "/listcontents" : ""))">
                            <strong>@item.Title</strong> </a>
                    </td>
                    <td>
                        @(System.Text.ASCIIEncoding.Unicode.GetByteCount(item.Title + item.Description + item.ContentXml) / 1024)
                        kB
                    </td>
                    <td class="state-published">
                        @(item.ModifiedOn != null ? item.CreatedOn : item.ModifiedOn)
                    </td>
                    <td>
                        <span class="state-published">@(item.IsPublished == true || item.IsPublished == false ? "Published" : "Private")</span>
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
else
{
    <text>No Items Found!</text>
}
